uniform sampler2D uni_sampler2D_gPosition;
uniform sampler2D uni_sampler2D_gNormal;
uniform sampler2D uni_sampler2D_gExt;
uniform sampler2D uni_sampler2D_sphere;
varying vec2 var_vec2_texcoord0;
varying vec3 var_vec3_farRay;

void main()
{
	float linearDepth=texture2D(uni_sampler2D_gPosition,var_vec2_texcoord0).x;
	float reflection=texture2D(uni_sampler2D_gExt,var_vec2_texcoord0).b;
	vec3 nor=texture2D(uni_sampler2D_gNormal,var_vec2_texcoord0).xyx;
	vec3 pos=var_vec3_farRay*linearDepth;
	nor.z=sqrt(1.0f-nor.x*nor.x-nor.y*nor.y);
	vec3 norTexcoord=normalize(reflect(pos,nor));
    norTexcoord=norTexcoord*0.5+0.5;
	gl_FragColor=texture2D(uni_sampler2D_sphere,norTexcoord.xy);
}